Skip to content

Add Project File Info to Diagnostics Window Output#1119

Merged
mjbvz merged 8 commits intomicrosoft:masterfrom
mjbvz:add-file-info-to-diag-window
Jul 7, 2016
Merged

Add Project File Info to Diagnostics Window Output#1119
mjbvz merged 8 commits intomicrosoft:masterfrom
mjbvz:add-file-info-to-diag-window

Conversation

@mjbvz
Copy link
Copy Markdown
Contributor

@mjbvz mjbvz commented Jun 30, 2016

This builds on #1118 to add some additional information about what a user's project looks like in the Diagnostics window.

Issue #1116

Bug

For perf investigations, we would like to be able to understand what type of projects users are working with

Fix

Add first patch of information: information about the number and type of files found in the project to the diagnostics window. Here's some example output:

Use Ctrl-C to copy contents

Projects:
    Project: ExpressApp11\ExpressApp11.njsproj
        Kind: Node.js
        StartupFile: C:\Users\matb.REDMOND\documents\visual studio 2015\Projects\ExpressApp11\ExpressApp11\bin\www
        WorkingDirectory: .
        PublishUrl: <undefined>
        SearchPath: <undefined>
        CommandLineArguments: <undefined>
        Analysis Log: 
        Analysis loading...
        Files:
            .js:
                Number of Files: 3
                Average Line Count: 26
                Max Line Count: 61
            .json:
                Number of Files: 2
                Average Line Count: 18
                Max Line Count: 22
            .styl:
                Number of Files: 1
                Average Line Count: 5
                Max Line Count: 5
            .md:
                Number of Files: 1
                Average Line Count: 3
                Max Line Count: 3
            .jade:
                Number of Files: 3
                Average Line Count: 6
                Max Line Count: 7

Bug
For perf investigations, we would like to be able to understand what type of projects users are working with.

Fix
Add some basic info to the Diagnostics window. This info capture the types of tiles in a project and the average file length for each of these.
@mjbvz mjbvz changed the title Add Project File info to Project Add Project File Info to Diagnostics Window Output Jun 30, 2016
@mjbvz
Copy link
Copy Markdown
Contributor Author

mjbvz commented Jun 30, 2016

The diff for this PR is kind of scary looking right now because of the method extractions. Please look at #1118 first since this change builds on it.

@mjbvz
Copy link
Copy Markdown
Contributor Author

mjbvz commented Jun 30, 2016

The other piece of information we probably want:

  • Information about Node modules.
  • Perhaps file size in addition to line count (for minified files)
  • Any other info that the Typescript team thinks would be helpful.

using Microsoft.NodejsTools.Logging;
using Microsoft.VisualStudioTools;
using Microsoft.VisualStudioTools.Project;
using System.Collections.Generic;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sort usings

@mousetraps
Copy link
Copy Markdown
Contributor

More generally, how did you test this change? Esp wrt perf impact - it would be a tad unfortunate for someone to have perf issues, open the diagnostics window, and then be subject to even more perf issues.

@mousetraps
Copy link
Copy Markdown
Contributor

Re: other info to add - node_modules would certainly be good (at the very least the info from package.json since we ask people to send us that all the time)

@mjbvz
Copy link
Copy Markdown
Contributor Author

mjbvz commented Jul 6, 2016

The change was tested with a few different project types and without any NTVS project. I tested a mid sized project as well (eslint source) and there is a slight delay while getting file info, but nothing terrible since this is a user initiated action.

If we upload some of this info with our telemetry, we could get away with uploading the file count ever so often, since that's just an iteration through a dictionary, but the file size / line count information is too expensive for large projects.

"CommandLineArguments"
};

private static readonly string[] interestingFileExtensions = new[] {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: prepend with underscore

@mousetraps
Copy link
Copy Markdown
Contributor

👍

@mjbvz mjbvz merged commit b2e7e75 into microsoft:master Jul 7, 2016
@mjbvz mjbvz removed the in-progress label Jul 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants